 

import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/support/swparamstation/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/support/swparamstation',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/support/swparamstation/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/support/swparamstation/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/support/swparamstation',
    method: 'put',
    data: obj
  })
}
/*
export function saveBatch(body) {
  return request({
    url: '/support/swparamstation/import',
    headers: { "Content-Type": "multipart/form-data" },
    method: 'post',
    data: body
  })
}*/
export function getDetailCode(code){
  return request({
    url:`/support/swparamstation/byCode/${code}`,
    method:'get'
  })
}
export function getDetailName(station){
  return request({
    url:'/support/swparamstation/byName',
    method:'post',
    headers: { "Content-Type": "application/json" },
    data: station
  })
}
/**
 * 车站参数导入
 * @param {*} body 
 * @returns 
 */
export function stationCodeImport(body) {
  return request({
    url: "/support/swparamstation/import",
    headers: { "Content-Type": "multipart/form-data" },
    method: "post",
    data: body
  })
}
/**
 * 模板下载
 * @param {*} query 
 * @returns 
 */
 export function templateStation(query) {
  return request({
    url: "/support/swparamstation/exportTamplate", 
    method: 'get',
    responseType: 'blob',
    params: query
  }) 
 }

